package com.compass.doctor.ui.patient.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import com.compass.doctor.R
import com.compass.framework.model.Tag
import com.compass.doctor.databinding.LayoutPatientTagItemBinding
import com.compass.framework.adapter.BaseBindViewHolder
import com.compass.framework.adapter.BaseRecyclerViewAdapter
import com.compass.framework.utils.getDrawableResource

/**
 * Description： 患者标签adapter
 * Date:2023/11/15 16:06
 */
class PatientTagAdapter : BaseRecyclerViewAdapter<Tag, LayoutPatientTagItemBinding>() {
    override fun onBindDefViewHolder(
        holder: BaseBindViewHolder<LayoutPatientTagItemBinding>,
        item: Tag?,
        position: Int
    ) {
        if (item == null) return
        holder.binding.apply {
            tvName.text = item.title
            tvName.background=(getDrawableResource(R.drawable.bg_patien_tags))

        }
    }

    override fun getViewBinding(
        layoutInflater: LayoutInflater,
        parent: ViewGroup,
        viewType: Int
    ): LayoutPatientTagItemBinding {
        return LayoutPatientTagItemBinding.inflate(layoutInflater, parent, false)
    }
}